<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['异常警报','传感器损坏明细[人工]']" icon="fa fa-exclamation-circle" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
					<h2>传感器损坏明细[人工]</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn" style="width: -moz-calc(100% - 210px);width: -webkit-calc(100% - 210px);width: calc(100% - 210px);">
								<sa-company-tree-car companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree-car>
								
								<div class="top_module top_module_box">
									<span class="top_module_label module_text">人工检测损坏通道</span>
									<select name="" class="top_module_select" id="channel" (change)='refresh()' [(ngModel)]="channel" style="min-width: 120px;">
										<option value="">全部</option>
										<option *ngFor="let item of optionList,let i = index" [attr.value]='i+1'>CH: {{i+1}}</option>
									</select>
								</div>
								<div class="top_module top_module_box">
									<span class="top_module_label module_text">传感器类型</span>
									<sa-sensor-type (sensorSelected)="sensorSelected($event)" Height="28px" [isShow]='true' type='1' [inputParam]="inputParam" [isSendRequest]='false'></sa-sensor-type>
								</div>
								<div class="top_module top_module_box">
									<span class="top_module_label module_text">时间类型</span>
									<select name="" class="top_module_select" id="type" (change)='refresh()' [(ngModel)]="type" style="min-width: 120px;">
										<option value="1">记录时间</option>
										<option value="2">开始时间[人工]</option>
										<option value="3">结束时间[人工]</option>
									</select>
								</div>
								<div class="selectDate top_module">
									<table-select-date [notInit]='true' (outerTime)="getSelectTableTime($event)"></table-select-date>
								</div>
								<button type="button" class="btn btn-primary" (click)="table_search()">查询</button>
								<button type="button" class="btn btn-primary" (click)="dataExceport()">导出</button>
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="车牌,录入人员...">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>设备ID</th>
										<th>车牌号</th>
										<th>传感器类型</th>
										<th>人工检测损坏通道</th>
										<th>开始时间[人工]</th>
										<th>结束时间[人工]</th>
										<th>记录时间</th>
										<th>记录人员</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData; let i = index" 
										[attr.data-index]="i" 
										[ngClass]="{selected:activeSelected === row.id}"
									>
										<td>{{row.deviceId}}</td>
										<td>{{row.carNumber}}</td>
										<td>
											<sa-sensor-type [sensorTypeId]="row.sensorType" type='2' [inputParam]="inputParam" [isSendRequest]='false'></sa-sensor-type>
										</td>
										<td>{{row.channel}}</td>
										<td>{{row.startTime}}</td>
										<td>{{row.endTime||'无'}}</td>
										<td>{{row.updateTime}}</td>
										<td>{{row.updateUser}}</td>
										<td>
											<button type="button" (click)="myModal.show();editRow(row)">编辑</button>
											<button type="button" (click)="delete_row(row)">删除</button>
											<button type="button" (click)='checkAbnormal(row)'>查看</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator 
								[totalRecords]="totalCount" 
								[rows]="pageSize" 
								[currentPage]="curPage - 1" 
								(onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
	<div style="background: white;border-radius: 5px;margin-top: 5px;position: relative;" [hidden]="!isChartView">
		<button (click)="closeChart()" class="div_closeBtn"> × </button>
		<div class="widget-body no-padding" style="margin: 0;">
			<div class="page-header clearfix s_table_opreation" style="margin: 0;">
				<div class="left page-header-btn" style="padding: 5px;">
					<div class="top_module">
						<span class="module_text" style="background: none;">数据折线图</span>
					</div>
					<div style="display: inline-block;">
						<div>
							<div class="selectDate top_module">
								<table-select-date [notInit]='true' [specifyId]='specifyId' [specifyTime]='specifyTime' (outerTime)="getSelectChartTime($event)"></table-select-date>
							</div>
							<button type="button" class="btn btn-primary" (click)="drawAbnormalChart()">查看</button>
						</div>
					</div>
				</div>
			</div>
		</div>
		<sa-chart-bmap [height]='325' [isAuditData]='false' [offDatas]='true' [inputParams]='selectedRow' [isBaiduMap]='true' (outerSend)="runParent($event)" (outerIsMap)='showMapView($event)'></sa-chart-bmap>
		<div [hidden]='!isMapView'>
			<sa-bmap-chart [trackParams]='drawTrackArr' [isShowBmap]='isMapView' deviceId="deviceId"></sa-bmap-chart>
		</div>
	</div>
	<!-- 编辑弹窗 -->
	<div bsModal #myModal="bs-modal" class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" (click)="myModal.hide()">
						&times;
					</button>
					<h4 class="modal-title" id="">编辑</h4>
				</div>
				<div class="modal-body col-xs-12">
					<form action="" class="form-horizontal" id="editForm">
						<div class="form-group s_fix_select2">
							<label class="control-label col-sm-2 no-padding-right">车牌号码</label>
							<div class="col-sm-10">
								<input class="form-control" type="text" name="carNumber" disabled="disabled" [(ngModel)]='editRowParams.carNumber'/>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-2 no-padding-right">开始时间</label>
							<div class="col-xs-10">
								<input class="form-control" type="text"  [(ngModel)]='editRowParams.startTime' name='startTime' id="startTime" autocomplete="off"/>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-2 no-padding-right">结束时间</label>
							<div class="col-xs-10">
								<input class="form-control" type="text"  [(ngModel)]='editRowParams.endTime' name='endTime' id="endTime" autocomplete="off"/>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-2 no-padding-right">人工检测损坏通道</label>
							<div class="col-sm-10">
								<div class="clearfix fix_select2">
									<select style="width:100%" class="form-control" name="channel" [(ngModel)]="editRowParams.channel">
										<option *ngFor="let item of optionList,let i = index" [attr.value]='i+1'>CH {{i+1}}</option>
									</select>
								</div>
							</div>
						</div>
					</form>
				</div>
				<div class="modal-footer" style="clear: both;">
					<button type="button" class="btn btn-default" (click)="myModal.hide()">关闭</button>
					<button type="button" class="btn btn-primary" (click)='submitUpdate(myModal)'>保存</button>
				</div>
			</div>
		</div>
	</div>
</div>